package com.igor.bookStore.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.igor.bookStore.inface.*;

public class PurchasesBean implements Purchases{
	
        private Map<String, Purchase> purchases = new HashMap<String, Purchase>();
        
        public Collection<Purchase> retrieve() {
                return purchases.values();
        }

        public Purchase save(Purchase purchase) {
                return purchases.put(purchase.getId(), purchase);
        }
        
        public Purchase retrieveSinglePurchase(String id) {
                return purchases.get(id);
        }


}
